<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>1</title>
    <script src="https://unpkg.com/vue@next"></script>
</head>
<style>
    .red{
        color: red;
    }
    .blue{
        color:blue;
    }
    .yellow{
        color: yellow;
    }
</style>
<body>
    <div id='root'>
        <div v-for="(item,index) in list" :key="index">{{item}}--{{index}}</div>
        <div v-for="(value,key,index) in obj" :key="index">{{value}}--{{key}}--{{index}}</div>
        <button @click="handleButton">button</button>
        <hr>
        <div>循环优先级大于 判断优先级</div>
        <div>template 模板 可以代替多产生的div</div>
    </div>
    <script>
        let app = Vue.createApp({
            data() {
                return {
                    list:['li','an','jin'],
                    obj:{
                        'fist':'lii',
                        "lastname":'jin',
                        "age":32,
                        'cars':['aa','bb']
                    }
                }
            },
            methods:{
                handleButton(){
                    this.list.push('aaa')
                    this.list[2]='3ad'
                    this.obj.age = 23
                    this.obj.cars[3]='zz'
                }
            }
        })

        let vm = app.mount('#root')
    </script>
</body>
</html>